< previous page page_110 next page >

Page 110
After you learn how to develop input validation routines, you build a set of validation custom controls. These custom controls handle seven valuable validation routines that you can use in your projects throughout the book. You can also use these custom controls in any project you build in the future.
Also, today is the day you build the main data entry form for the MASTER.MDB database. You use this database and data entry form in several chapters of the book. You use all the techniques you've learned this week, including the use of bound data controls and input validation to build a solid data entry form.
Before you get into the details of how to perform input validation, let's first talk about what input validation is and why it is so important to good database application design.
What Is Input Validation?
Input validation is the process of checking the data entered by the user before that data is saved to the database. Input validation is a proactive processit happens while data is being entered. Input validation is not the same thing as error trapping. Error trapping is a reactive processit happens after the data has been entered. This is an important point. Input validation should be used to prevent errors. If you have good input validation schemes, you have fewer errors to trap! You learn more about the reactive process on Day 14, ''Error Handling in Visual Basic 5."
Input validation can be used to give users guides on how to enter valid data. The best example of this kind of input validation is the use of a validation list. A validation list is a list of valid inputs for a field. If the user has only a limited number of possible valid choices for an input field, there is much less chance of a data entry error occurring. Good validation schemes give the user a list of valid input from which to choose while performing data entry.
Input validation can automatically edit data as the user enters it, instead of telling the user to fix invalid entries. For example, if the data entered in a field must be in all capital letters, the program should automatically convert lowercase characters to uppercase instead of waiting while the user enters mixed case, and then reporting an error and forcing the user to reenter the data.
Input validation reaches beyond the individual keystroke and field. It is also important to validate data at the form level. Input validation schemes should make sure that all required fields on a form are completed properly. If you have several fields that must be filled with valid data before the record can be saved to the database, you must have a method for checking those fields before you allow the user to attempt to save the record.
Conditional input fields must be validated, too. A conditional field is slightly different from a required field. Conditional fields usually occur when a user has checked a Yes/No box and

 
< previous page page_110 next page >

If you like this book, buy it!